package com.xfxplus.m.view.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.webkit.JavascriptInterface;
import android.webkit.WebView;
import android.widget.Toast;

import com.xfxplus.m.R;


public class MyWebActivity extends Activity {
	private WebView webView;
	private String url,title,qqq;// 项目ID
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.myweb);
        if(title==null||title.equals("")){
            title="活动介绍";
        }
		initInfo();
		init();
	}
	private void initInfo() {
		// TODO Auto-generated method stub

	}
	private void init() {
        // TODO Auto-generated method stub
        //fileUtils = new FileUtil(this);
        webView=(WebView) findViewById(R.id.acc_rech_web);
        webView.getSettings().setDefaultTextEncodingName("utf-8");
        webView.getSettings().setJavaScriptEnabled(true);
        webView.addJavascriptInterface(new JavaScriptObject(), "control");
        webView.loadUrl("http://h5.tpos.xunmall.net:30040/2018/05/08/H5_test.html");
	}

    @Override
    public void onBackPressed() {
        // TODO Auto-generated method stub
    }


    public class JavaScriptObject{
        @JavascriptInterface
        public String getId(){
                return "";
        }
        @JavascriptInterface
        public void AndroidMethod(String a){
            Toast.makeText(MyWebActivity.this,a,Toast.LENGTH_SHORT).show();
        }
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
    }
}
